package com.int_tech.user.service;

import com.int_tech.user.dao.UserDao;
import com.int_tech.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Created by Administrator on 2018/12/10.
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    //根据账号密码查询用户
    public User findUserByNameAndPassword (String name, String password){
        return userDao.findByNameAndPassword(name,password);
    }

    //根据id查询账号密码
    public User findUserById (int id){
        return userDao.findById(id);
    }

    //存储用户
    public void saveUser(User user){
         userDao.save(user);
    }

}
